design/copying a bunch of records - Mailing list pgsql-novice

From M Spreij
Subject design/copying a bunch of records
Date
Msg-id a05210602bb445b2d47d5@[192.168.1.12]
Whole thread Raw
Responses Re: design/copying a bunch of records  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
   Hi all,

I hope to be able to answer more questions than I need to ask later
on, but for now.. :-}

   I'm trying to make a system where the admin will create a set of
categories and products, sort order and all, where multiple users
will be able to make custom sets with the same records, with optional
translations, different prices, different product- and category
sortorder.  If the admin removes a product, the users won't be able
to use that anymore either (inner join, or a loop-delete from user
sets), but they can add their own products as well.  If the admin
adds a record, it would be copied to all user sets as well.  This
probably screams "duplicate data" but nearly all records will need
translations or price changes, and custom sorting, so I couldn't
figure any other good way.
   So I figured the best way was to copy the records from the
admin-set to user-sets (but suggestions for other ways are very
welcome!), and was wondering if there is a 'good' way to copy about
50 records to different tables every time you add a user account -
the only way I can think of is write some loops in PHP. Better ways?
TIA!

Regards,

     Martin
--
<mailto:mac.com@nemo>
<http://www.mechintosh.com/>

pgsql-novice by date:

Previous
From: "Patrick Hatcher"
Date:
Subject: Re: Need clarifications......
Next
From: Josh Berkus
Date:
Subject: Re: design/copying a bunch of records